USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[Employee_GetAdvanceByEmployeeID]    Script Date: 02/10/2012 11:26:03 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		GIANGPNT
-- Create date: 24/10/2011
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[Employee_GetAdvanceByEmployeeID] 
	@EmployeeID			BIGINT,
	@FromDate	DATETIME,
	@ToDate		DATETIME,
	@Type		NVARCHAR(50)
AS
BEGIN
	SELECT	A.*, E.Username, E.FullName
	FROM	Advance A JOIN Employee E ON A.EmployeeID = E.EmployeeID
	WHERE	A.Type LIKE N'%' + @Type + '%' 
	AND A.EmployeeID = @EmployeeID 
	AND A.DateAdvance BETWEEN @FromDate AND @ToDate
END

GO

